'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH DI_DEVLINK_PATH 3DEVINFO "May 15, 2008"
.SH NAME
di_devlink_path, di_devlink_content, di_devlink_type \- get devlink attributes
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-ldevinfo\fR [ \fIlibrary\fR... ]
#include <libdevinfo.h>

\fBconst char *\fR\fBdi_devlink_path\fR(\fBdi_devlink_t\fR \fIdevlink\fR);
.fi

.LP
.nf
\fBconst char *\fR\fBdi_devlink_content\fR(\fBdi_devlink_t\fR \fIdevlink\fR);
.fi

.LP
.nf
\fBint\fR \fBdi_devlink_type\fR(\fBdi_devlink_t\fR \fIdevlink\fR);
.fi

.SH PARAMETERS
.sp
.ne 2
.na
\fB\fIdevlink\fR\fR
.ad
.RS 11n
An opaque handle to a devlink.
.RE

.SH DESCRIPTION
.sp
.LP
These functions return various attributes of a devlink.
.SH RETURN VALUES
.sp
.LP
The \fBdi_devlink_path()\fR function returns the absolute path of a devlink. On
error, \fINULL\fR is returned and \fBerrno\fR is set to indicate the error.
.sp
.LP
The \fBdi_devlink_content()\fR function returns the content of the symbolic
link represented by \fIdevlink\fR. On error, \fINULL\fR is returned and
\fBerrno\fR is set to indicate the error.
.sp
.LP
The \fBdi_devlink_type()\fR function returns the devlink type, either
\fBDI_PRIMARY_LINK\fR or \fBDI_SECONDARY_LINK\fR. On error, -1 is returned and
\fBerrno\fR is set to indicate the error.
.SH ERRORS
.sp
.LP
These functions will fail if:
.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 10n
The \fIdevlink\fR argument is invalid.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7)  for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
_
MT-Level	Safe
.TE

.SH SEE ALSO
.sp
.LP
.BR malloc (3C),
.BR di_devlink_init (3DEVINFO),
.BR di_devlink_walk (3DEVINFO),
.BR libdevinfo (3LIB),
.BR attributes (7)
